package org.shoukaiseki.erp.entity;


import org.shoukaiseki.ruoyi.Interface.DictTypeEnumData;

import java.util.ArrayList;
import java.util.List;

public class BaseDictEnum implements DictTypeEnumData {


    private Object value;

    private String label;

    private int sort=0;

    private String remark="";

    private char status='0';

    public BaseDictEnum(){

    }

    public BaseDictEnum(Object value, String label) {
        this(value, label, 0);
    }

    public BaseDictEnum(Object value, String label, int sort) {
        this.value = value;
        this.label = label;
        this.sort = sort;
    }

    public BaseDictEnum(Object value, String label, String remark) {
        this(value, label, 0, remark);
    }

    public BaseDictEnum(Object value, String label, int sort, String remark) {
        this(value, label, sort, remark, '0');
    }

    public BaseDictEnum(Object value, String label, int sort, String remark, char status) {
        this.value = value;
        this.label = label;
        this.sort = sort;
        this.remark = remark;
        this.status=status;
    }

    public BaseDictEnum(Integer value, String label, int sort) {
        this.value = value;
        this.label = label;
        this.sort = sort;
    }

    public BaseDictEnum(Integer value, String label, String remark) {
        this(value, label, value, remark);
    }

    public BaseDictEnum(Integer value, String label, int sort, String remark) {
        this(value, label, sort, remark, '0');
    }

    public BaseDictEnum(Integer value, String label, int sort, String remark, char status) {
        this.value = value;
        this.label = label;
        this.sort = sort;
        this.remark = remark;
        this.status=status;
    }



    @Override
    public String getValueString() {
        return this.value.toString();
    }

    @Override
    public int getValueInteger() {
        return DictTypeEnumData.super.getValueInteger();
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public int getSort() {
        return sort;
    }

    @Override
    public String getRemark() {
        return remark;
    }

    @Override
    public String getStatus() {
        return String.valueOf(status);
    }


    public List<BaseDictEnum> newListAutoSort(BaseDictEnum... dictEnums){
        List<BaseDictEnum> list = new ArrayList<>();
        for (int i = 0; i < dictEnums.length; i++) {
            BaseDictEnum dictEnum=dictEnums[i];
            dictEnum.sort=(i+1)*10;
            list.add(dictEnum);
        }
        return list;
    }
}
